import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Rectangle;

import javax.swing.*;
import javax.swing.border.TitledBorder;

import java.awt.Component;

public class ComplaintDetailsGUI  extends JFrame
{
	private JLabel complaintLabel = null;
	private JLabel uidLabel = null;
	private JLabel fNameLabel = null;
	private JLabel lNameLabel = null;
	private JLabel typeLabel = null;
	private JTextField complaintField = null;
	private JLabel ReplyLabel = null;
	private JTextField ReplyTextField = null;
	private JButton backButton = null;
	private JButton replyButton = null;
	private JButton compenstionButton = null;
	private JPanel contentPane=null;
	
	public ComplaintDetailsGUI ()
	{ 		  
		 //Complain tDetails panel
		   contentPane=new JPanel();	
		   
		   contentPane.setBorder(new TitledBorder(null, "Complaints Details", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		   contentPane.setLayout(null);
		   contentPane.setOpaque(true);
		
		   contentPane.add( getUIDLabel());
		   contentPane.add(getfNameLabel());
		   contentPane.add(getlNameLabel());
		   contentPane.add(getTypeLabel());
		   contentPane.add(getComplaintField());
			contentPane.add(getReplyLabel());
			contentPane.add(getReplyField());
			contentPane.add(geReplyButton());
			contentPane.add(getCompenstionButton());
			contentPane.add(geBackButton(),BorderLayout.SOUTH);
	        

			  //Frame
		        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		        this.setTitle("Compliant Deatails Window");
		        this.setContentPane(contentPane);  
			    this.setLocationRelativeTo(null); //This will center the JFrame in the middle of the screen
		        this.setLocationByPlatform(true);
		        this.setSize(500, 500);
		        this.setVisible( true ); // display frame
		
	          
	               
	  }
	

	
	/**
	 * This method initializes UID  Label
	 */
	private JLabel getUIDLabel() {
		if (uidLabel == null) {
			  uidLabel = new JLabel();
			   uidLabel.setBounds(new Rectangle(50, 50, 20, 17));
			   SetGenLabel("UID",uidLabel);
		}
		return uidLabel;
	}
	
	/**
	 * This method initializes fName Label
	 */
	private JLabel getfNameLabel() {
		if (fNameLabel == null) {
			fNameLabel = new JLabel();
			   fNameLabel.setBounds(new Rectangle(150, 50, 40, 17));
			   SetGenLabel("fName",fNameLabel);
		}
		return fNameLabel;
	}
	
	/**
	 * This method initializes lName Label
	 */
	private JLabel getlNameLabel() {
		if (lNameLabel == null) {
			lNameLabel = new JLabel();
			lNameLabel.setBounds(new Rectangle(250, 50, 40, 17));
			   SetGenLabel("lName",lNameLabel);
		}
		return lNameLabel;
	}
	
	/**
	 * This method initializes Type Label
	 */
	private JLabel getTypeLabel() {
		if (typeLabel == null) {
			typeLabel = new JLabel();
			typeLabel.setBounds(new Rectangle(350, 50, 40, 17));
			   SetGenLabel("Type",typeLabel);
		}
		return typeLabel;
	}
	
	/**
	 * This method initializes Reply Label
	 */
	private JLabel getReplyLabel() {
		if (ReplyLabel == null) {
			ReplyLabel = new JLabel();
			ReplyLabel.setBounds(new Rectangle(50, 169, 100, 17));
			   SetGenLabel("Reply:",ReplyLabel);
		}
		return ReplyLabel;
	}
	
	
	
	
	/**
	 * This method set JLablel Text genric
	 */
	private void SetGenLabel(String text,JLabel label) {
		if (label != null) {

			label.setText(text);
		}
	}
	
	
	
	
	/**
	 * This method initializes Compliant Details Text Field	
	 */
	private JTextField getComplaintField() {
		if (complaintField == null) {
			complaintField = new JTextField();
			complaintField.setBounds(new Rectangle(50, 70, 350, 100));
			complaintField.addFocusListener(new java.awt.event.FocusAdapter() {
				public void focusLost(java.awt.event.FocusEvent e) {
					
				}
			});
		}
		return complaintField;
	}
	
	/**
	 * This method initializes Reply Text Field	
	 */
	private JTextField getReplyField() {
		if (ReplyTextField == null) {
			ReplyTextField = new JTextField();
			ReplyTextField.setBounds(new Rectangle(50, 200, 350, 100));
			ReplyTextField.addFocusListener(new java.awt.event.FocusAdapter() {
				public void focusLost(java.awt.event.FocusEvent e) {
					
				}
			});
		}
		return ReplyTextField;
	}
	
	/**
	 * This method initializes Send Reply Button	
	 */
	private JButton geReplyButton() {
		if (replyButton == null) {
			replyButton = new JButton();
			replyButton.setBounds(new Rectangle(70, 320, 100, 35));
			replyButton.setText("Send Reply");
			replyButton.addActionListener(new java.awt.event.ActionListener() 
			{
				public void actionPerformed(java.awt.event.ActionEvent e) 
				{
					
				
				}
			});
		}
		return replyButton;
	}
	
	/**
	 * This method initializes Compensate Customer Button	
	 */
	private JButton getCompenstionButton() {
		if (compenstionButton == null) {
			compenstionButton = new JButton();
			compenstionButton.setBounds(new Rectangle(200, 320,170, 35));
			compenstionButton.setText("Compensate Customer");
			compenstionButton.addActionListener(new java.awt.event.ActionListener() 
			{
				public void actionPerformed(java.awt.event.ActionEvent e) 
				{
					
					              
				
				}
			});
		}
		return compenstionButton;
	}
	
	/**
	 * This method initializes Back Button	
	 */
	private JButton geBackButton() {
		if (backButton == null) {
			backButton = new JButton();
			backButton.setBounds(new Rectangle(145, 380,150, 35));
			backButton.setText("Back to main");
			backButton.addActionListener(new java.awt.event.ActionListener() 
			{
				public void actionPerformed(java.awt.event.ActionEvent e) 
				{
					
					     
				
				}
			});
		}
		return backButton;
	}
	
}
